package com.efeichong.common.exception;


import com.efeichong.enums.ResultEnum;

/**
 * @author lxk
 * @date 2020/9/8
 * @description 业务异常
 */
public class CustomException extends RuntimeException {
    private Integer code = ResultEnum.FAILED.getStatus();
    private String message;

    public CustomException() {
        super(ResultEnum.FAILED.getMessage());
    }

    public CustomException(String message) {
        super(message);
        this.message = message;
    }

    public CustomException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public CustomException(String message, Throwable error) {
        super(message, error);
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
